class AdminSessionsController < ApplicationController

	def new
		render layout: "admin_layout"
    @admin_session = AdminSession.new
  end
  
  def create
    @admin_session = AdminSession.new(params[:admin_session])
    if @admin_session.save
			flash[:notice] = "Logged in successfuly $green"
      redirect_to :controller => "events", :action => "index"
    else
      render :layout => "admin_layout", :action => :new
    end
  end
  
  def destroy
    current_admin_session.destroy
    flash[:notice] = "Logout successful! $blue"
    redirect_to :controller => "events", :action => "index"
  end

end
